layui.use('element', function() {
		var $ = layui.jquery,
			element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块

		//触发事件
		var active = {
			tabChange: function(e) {
				//切换到指定Tab项
				element.tabChange('demo', '22'); //切换到：用户管理
			}
		};

	});
	let data = [{
		"number": "1",
		"documentype": "草稿箱",
		"quotationdate": "流程模板",
		"dcumentno ": "123456789",
		"quotationdate": "2021-07-21",
		"country": "美国",
		"customername": "张三",
		"customercontact": "李四",
		"contactemail": "12311111@qq.com",
		"effectivedate": "2021-07-21",
		"deliveryterm": "2021-07-21",
		"priceterms": "aaaaaaaaaa",
		"totalquotation": "146",
		"salesman": "超级管理员"
	}]
	let data1 = [{
		"number": "1",
		"nodename": "财务审核",
		"participant": "李四",
		"timeconsuming": "1分40秒",
		"acceptancetime": "2021-07-21",
		"completiontime": "2021-07-21",
		'operation': "同意"
	}]
	let data2 = [{
		"number": "1",
		"documentype": "草稿箱",
		"quotationdate": "流程模板",
		"dcumentno ": "123456789",
		"quotationdate": "2021-07-21",
		"country": "美国",
		"customername": "张三",
		"customercontact": "李四",
		"contactemail": "12311111@qq.com",
		"signingdate": "2021-07-21",
		"deliveryterm": "2021-07-21",
		"priceterms": "aaaaaaaaaa",
		"totalquotation": "146",
		"salesman": "超级管理员",
		'contractno': "nnnnn1111",
		'customercontractno': '11111111111',
		'currency': '美元',
		'totalcontractamount': "1555",
		'businessmodel': "正常模式",
		'iscustoms': "否",
		'acollectionscale': "0",
		'acollectionamount': "0",
		'customeraccounting': "20",
		'signingcompany': "上海某公司"
	}]
	layui.use(['form', 'table', 'layedit', 'laydate'], function() {
		var form = layui.form,
			layer = layui.layer,
			layedit = layui.layedit,
			laydate = layui.laydate;
		var table = layui.table;
	
		table.render({
			elem: '#test',
			data: data,
			cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
				,
			cols: [
				[{
						field: 'number',
						title: '序号'
					}, {
						field: 'documentype',
						title: '单据类型'
					}, {
						field: 'dcumentno ',
						title: '报价单号',
						event: 'dcumentNo',
						style: 'cursor: pointer;'
					}, {
						field: 'quotationdate',
						title: '报价日期'
					} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
					, {
						field: 'customername',
						title: '客户名称'
					}, {
						field: 'country',
						title: '国家'
					}, {
						field: 'customercontact',
						title: '客户联系人'
					}, {
						field: 'contactemail',
						title: '联系人邮箱'
					},
					{
						field: 'effectivedate',
						title: '报价有效期'
					},
					{
						field: 'deliveryterm',
						title: '交货期限'
					},
					{
						field: 'priceterms',
						title: '价格术语'
					},
					{
						field: 'totalquotation',
						title: '报价总额'
					},
					{
						field: 'salesman',
						title: '业务员'
					}
				]
			],
			// page: true
		})
		table.render({
			elem: '#test2',
			data: data2,
			cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
				,
			cols: [
				[{
						field: 'number',
						title: '序号'
					}, {
						field: 'documentype',
						title: '单据类型'
					}, {
						field: 'signingdate',
						title: '签约日期'
					} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
					,
					{
						field: 'salesman',
						title: '业务员'
					},
					{
						field: 'contractno',
						title: '合同编号'
					},
					{
						field: 'customername',
						title: '客户名称'
					}, {
						field: 'currency',
						title: '币种'
					}, {
						field: 'totalcontractamount',
						title: '合同总额'
					},
					{
						field: 'priceterms',
						title: '价格术语'
					}, , {
						field: 'businessmodel',
						title: '业务模式'
					},
					{
						field: 'iscustoms',
						title: '是否报关'
					},
					{
						field: 'acollectionscale',
						title: '预收款比例'
					},
	
					{
						field: 'acollectionamount',
						title: '预收款金额'
					},
					{
						field: 'customeraccounting',
						title: '客户账期'
					},
					{
						field: 'signingcompany',
						title: '签约公司'
					}
	
				]
			],
			// page: true
		})
		table.render({
			elem: '#test1',
			data: data1,
			cellMinWidth: 80 //全局定义常规单元格的最小宽度，layui 2.2.1 新增
				,
			cols: [
				[{
						field: 'number',
						title: '序号'
					}, {
						field: 'nodename',
						title: '节点名称'
					}, {
						field: 'acceptancetime',
						title: '接受时间'
					}, {
						field: 'completiontime',
						title: '完成时间'
					} //minWidth：局部定义当前单元格的最小宽度，layui 2.2.1 新增
					, {
						field: 'timeconsuming',
						title: '耗时'
					}, {
						field: 'participant',
						title: '参与者',
						style: 'color: #007BFF;'
					},
					{
						field: 'operation',
						title: '操作'
					}
				]
			],
			// page: true
		})
		table.on('row(test)', function(obj) {
			parent.layui.index.openTabsPage('views/jsp/Processcenter/bjmx.jsp', '报价明细');
		});
		table.on('row(test1)', function(obj) {
			parent.layui.index.openTabsPage('views/jsp/Processcenter/wx.jsp', '外销明细');
		});
	});
	//转办弹框
	function zhuanban() {
		layer.open({
			type: 2,
			title: '转办',
			maxmin: true,
			shadeClose: true, //点击遮罩关闭层
			area: ['800px', '340px'],
			content: 'views/jsp/Processcenter/zhuanban.jsp'
		});
	}
	//传阅弹框
	function chuanyue() {
		layer.open({
			type: 2,
			title: '传阅',
			maxmin: true,
			shadeClose: true, //点击遮罩关闭层
			area: ['800px', '340px'],
			content: 'views/jsp/Processcenter/chuanyue.jsp'
		});
	}
	//审批通过或者驳回返回代办页面？
	function navto() {
		parent.layui.index.openTabsPage('views/jsp/Processcenter/mydaiban.jsp', '我的代办');
	}